import junit.framework.TestCase;

import org.junit.*;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

public class TestCrearServicio extends TestCase{

	private final String URL = "http://localhost:8080";
	private final String BROWSER_TYPE = "*firefox /opt/firefox/firefox-bin";
	private Selenium browser;

	@Before
	public void setUp() throws Exception {
		browser = new DefaultSelenium("localhost", 4444, BROWSER_TYPE, URL);
		browser.start();

	}

	@Test
	public void testAccederAdictosDesdeGoogle() throws InterruptedException {

		browser.open("/sircon/");
		browser.click("id=index_form:btn_administrativo");
		browser.waitForPageToLoad("30000");
		browser.click("//div[@id='admin_menu_form:item_servicios:header']/table/tbody/tr/td/div[2]");
		browser.click("name=admin_menu_form:j_idt30");
		browser.waitForPageToLoad("30000");
		browser.type("name=form_servicios:j_idt38", "selenium prueba");
		browser.type("name=form_servicios:j_idt40", "a ver si esto funciona bonito");
		browser.type("name=form_servicios:j_idt42", "consepto");
		browser.type("name=form_servicios:j_idt44", "10");
		browser.type("name=form_servicios:j_idt46", "10");
		browser.click("name=form_servicios:j_idt49");
		browser.waitForPageToLoad("30000");
	}

	public void tearDown() {
		browser.stop();
	}
}
